Skip to content

Conversation

@bgreni
Copy link
Collaborator

@bgreni bgreni commented Dec 5, 2024

  • Catch exceptions from service handler and return 500 error
  • Fix integration test and add test case
  • Contributes to Better error handling #3

@bgreni bgreni changed the title Catch exceptions from service handler and return interal error Catch exceptions from service handler and return internal error Dec 5, 2024
@bgreni bgreni force-pushed the catch-handler-exceptions branch from adcbaaf to 2181258 Compare December 5, 2024 22:36
@bgreni
Copy link
Collaborator Author

bgreni commented Dec 5, 2024

@saviorand FYI this is a pretty harmless change so I'm going to go ahead and merge it. Just prevents the server from crashing if something goes wrong in the handler and allows users to create a 500 response by just raising an Error which I think is the intuitive behaviour.

@bgreni bgreni merged commit ea897f7 into Lightbug-HQ:main Dec 5, 2024
2 checks passed
@saviorand
Copy link
Collaborator

Nice! Also prints in integration tests are helpful. The only feedback I have is I found a typo in IntegerationTestService (should be IntegrationTestService) , also I think it's good to call INTERNAL_ERROR alias just INTERNAL_SERVER_ERROR because these aliases correspond to HTTP codes anyway. I can fix those two separately though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants